<!--/**
 * Plugin Name: 论坛展示型app
 * Description: uloug.com To develop and share! Please keep the copyright information!
 * Author: 拾讯网
 * Author URI: http://www.uloug.com
 * Version: 1.0
 * Plugin URI: https://git.oschina.net/858598758/apicloud.mao10.app.demo.git
 * License: GPL2+
 */-->
<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<title>Hello APP</title>
		<link rel="stylesheet" type="text/css" href="../../css/aui-win.css" />
		<style>
			.aui-nav .aui-bar-tab .aui-iconfont {
				line-height: 36px;
			}
		</style>
	</head>
	<body>
		<header class="aui-bar aui-bar-nav aui-bar-info" id="aui-header">
			<a class="aui-pull-left" tapmode onclick="openhback()"> <span class="aui-iconfont aui-icon-left aui-btn-info"></span> </a>
			<div class="aui-title" id="header-title">
				发现
			</div>
			<a class="aui-pull-right" tapmode onclick="closeWin()"> <span class="aui-iconfont aui-icon-close aui-btn-info"></span> </a>
		</header>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/common_do.js"></script>
	<script type="text/javascript">
		apiready = function() {
			api.parseTapmode();
			//网络判断
			var connectionType = api.connectionType;
			if (connectionType == 'none') {
				find_network_no();
			} else {
				network_yes();
			};
		}

		function find_network_no() {
			var header = $api.byId('aui-header');
			$api.fixStatusBar(header);
			var headerPos = $api.offset(header);
			var body_h = $api.offset($api.dom('body')).h;
			api.openFrame({
				name : 'find_frm',
				url : 'find_frm.html',
				bounces : false,
				rect : {
					x : 0,
					y : headerPos.h,
					w : headerPos.w,
					h : body_h - headerPos.h
				}
			})
		}

		//有网时打开
		function network_yes() {
			var header = $api.byId('aui-header');
			$api.fixStatusBar(header);
			var headerPos = $api.offset(header);
			var body_h = $api.offset($api.dom('body')).h;
			api.openFrame({
				name : 'find_opwin',
				url : 'http://sns.56ug.com',
				bounces : false,
				progress : {
					type : "default",
					title : "加载中", //type为default时显示的加载框标题
					text : "请稍候", //type为default时显示的加载框内容
					color : ""
				},
				rect : {
					x : 0,
					y : headerPos.h,
					w : headerPos.w,
					h : body_h - headerPos.h
				}
			})
		}

		function openhback() {
			api.historyBack({
				frameName : 'find_opwin'
			}, function(ret, err) {
				if (!ret.status) {
					api.closeWin();
				}
			});
		}
	</script>
</html>